// pages/authentication/index/index.js
Page({
  data: {
    formData: null
  },
  onLoad() {
    const res = wx.getStorageSync('ewmData') || null;
    res.student.gender = setGender( res.student.gender );

    res.educationalExperienceList =  res.educationalExperienceList.map( _s => {
      _s.education = setEducation( _s.education );
      return _s;
    } )
    this.setData({ formData: res });
  }
})

const genderArr = [ '未设置', '男', '女' ];
function setGender( type ) {
  return genderArr[ type ] || genderArr[ 0 ];
}

const educations = {
  '02': '高中',
  '03': '大学',
  '04': '研究生'
}

function setEducation( type ) {
  console.log(type);
  return educations[ type ] || '';
}

